package util.cvs.filter;

import com.opencsv.bean.CsvToBeanFilter;
import lombok.extern.slf4j.Slf4j;
import util.string.HilifeStringUtils;

/**
 * csv filter
 * <p>
 * Create on 2019-07-26 16:04
 *
 * @author tianbl
 */
@Slf4j
public class CsvToBeanFilterImpl implements CsvToBeanFilter {

    /**
     * 支付类型
     */
    private String payType;

    public CsvToBeanFilterImpl(String payType) {
        this.payType = payType;
    }

    @Override
    public boolean allowLine(String[] line) {
        if ("wx".equals(payType)) {
            log.info("## line 的长度 => {}",line.length);
                if(!HilifeStringUtils.isContainChinese(line[0])){
                    log.info("## 省略的数据 => {}", line);
                    return false;
                }

        } else if ("ali".equals(payType)) {

        } else {

        }
        return true;
    }
}
